import {
    createRouter,
    createWebHashHistory
} from "vue-router"

// 引入后台首页
import Index from "~/pages/index.vue"
// 引入 about 页面路由信息
import About from "~/pages/about.vue"
// 引入 404 页面
import NotFound from "~/pages/404.vue"
import Login from "~/pages/login.vue"

const routes = [{
    // 这里是路径
    path: "/",
    // 这里是路径指向的文件
    component:Index
},{
    path: "/about",
    component: About
},// 将匹配所有内容并将其放在 `$route.params.pathMatch` 下
    { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
    {path: "/login", component: Login}
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

// 返回router
export default router